package day06;

public class HomeWorkup1 {
    public static void out(int arr[]){
        for(int i=0;i<arr.length;i++) {
            System.out.print(arr[i] + "\t");
        }
    }
    public static int getMaxofArray(int arr[]){
        int max=arr[0];
        for(int i=1;i<arr.length;i++){
            if(arr[i]>max){
                max=arr[i];
            }
        }
        return max;

    }
    public static void main(String[] args) {

        int[] arr={56,89,95,25,36,21,52,51,47,65};
        out(arr);
        int max=getMaxofArray(arr);
        System.out.println(" ");
        System.out.println("最大值为："+max);

        int[] aay=new int[10];
        for (int i=0;i<aay.length;i++){
            aay[i]=(int)(Math.random()*100);
        }
        out(aay);
        int m = getMaxofArray(aay);
        System.out.println(" ");
        System.out.println("随机数的最大值为："+m);
    }
}
